package com.graduation.springbootinit.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.graduation.springbootinit.model.entity.ShopPart.RegionDict;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface RegionDictMapper extends BaseMapper<RegionDict> {
    
    @Select("SELECT * FROM shop_part_region_dict WHERE level = 1 ORDER BY sort_order")
    List<RegionDict> listProvinces();
    
    @Select("SELECT * FROM shop_part_region_dict WHERE parent_code = #{parentCode} ORDER BY sort_order")
    List<RegionDict> listByParentCode(String parentCode);
} 